package com.sinog.biz.service.business;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @desc 用户检查
 * @author lj
 * @date -
 */
@RestController
public interface UserLoginCheckService {

    /**
     * 登录失败，次数+1
     * @param userAccount userAccount
     * @param captchaLockNum captchaLockNum
     * @param captchaLockTime captchaLockTime
     * @param singlelLockTime singlelLockTime
     * @param ip ip
     */
    @GetMapping("/biz/lockUser")
    void lockUser(
            @RequestParam("userAccount") String userAccount,
            @RequestParam("captchaLockNum") Integer captchaLockNum,
            @RequestParam("captchaLockTime") Integer captchaLockTime,
            @RequestParam("singlelLockTime") Integer singlelLockTime,@RequestParam("ip") String ip);

    /**
     * 获取是否可登录状态
     * @param userAccount userAccount
     * @param captchaLockNum captchaLockNum
     * @param captchaLockTime captchaLockTime
     * @return boolean
     */
    @GetMapping("/biz/getUserLockSize")
    boolean getUserLockState(
            @RequestParam("userAccount") String userAccount,
            @RequestParam("captchaLockNum") Integer captchaLockNum,
            @RequestParam("captchaLockTime") Integer captchaLockTime);

    /**
     * 保存用户登录信息
     * @param userAccount userAccount
     * @param ip ip
     * @param loginState loginState
     * @param failCause failCause
     */
    @GetMapping("/biz/insertUserLoginDetails")
    void insertUserLoginDetails(
            @RequestParam("userAccount") String userAccount,
            @RequestParam("ip") String ip,
            @RequestParam("loginState") String loginState,@RequestParam("failCause") String failCause);

    /**
     * 用户登录信息列表集合
     * @param text text
     * @return String
     */
    @RequestMapping("/basic/login/getLoginDetailsList")
    String getLoginDetailsList(@RequestParam("text") String text);
}